﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BANGSINHVIEN2
{
    class DALlop
    {
        public DALlop() { 
        }
        public DataTable Docdanhsachlop() 
        {
            SqlConnection conn = new SqlConnection(@"Data Source=QUYNHUYEN\SQLEXPRESS;Initial Catalog=QLSV; User Id=sa; Password=sa");
            SqlDataReader dr = null;
            conn.Open();
            DataTable dt = new DataTable();
            SqlCommand cmd = new SqlCommand("select * from lop", conn);
            dr = cmd.ExecuteReader();     
            dt.Load(dr);
            return dt;
                 
           
            
        }
    }
}
